<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/5/31 0031
 * Time: 上午 10:31
 */

namespace app\sports_admin\vaildate;


class Parents extends Base
{

    protected $rule = [
        'id'=>'require|isPositiveInteger',
    ];

    protected $message = [
        'id'=>'编号必须为整数',
    ];

    //添加家长
    public function insert()
    {
        $rule = [
            'name'=>'require',
            'phone'=>['require','1(3|4|5|7|8)[0-9]\d{8}$'],
            'password'=>'require|min:6|max:20',
        ];
        $msg = [
            'name'=>'请输入姓名',
            'phone'=>'手机号格式错误',
            'password'=>'密码在6-20位之间'
        ];
        self::goCheck($rule,$msg);
    }
    //重置密码
    public function passwordReset()
    {
        $rule = [
            'id'=>'require|integer',
        ];
        $msg = [
            'id'=>'请选择编号'
        ];
        self::goCheck($rule,$msg);
    }
}